import java.util.Scanner;
import java.util.Arrays;

public class Main4 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = num.nextInt();
        }
        Arrays.sort(arr);
        int[] temp = new int[n];
        temp = arr;
        int[] temp2 = new int[n];
        for (int i = 0; i < n; i++) {
            int flag = 0;
            for (int j = i; j < n - 1; j++) {
                if (temp[j + 1] - temp[j] == 1) {
                    flag++;
                }
            }
            temp2[i] = flag;
        }
        int max = temp2[0];
        for (int i = 0; i < n; i++) {
            if (max < temp2[i]) {
                max = temp2[i];
            }
        }
        System.out.println(max + 1);
    }
}
